<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>jQueryAjax</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
</head>
<body>
<h1>jQueryAjax</h1>

  <button id="btn">直接查询</button>
  <button id="btnGet">get查询</button>


<script>

  $('#btn').click(function () {

    $.ajax({
      type:'GET',
      url:'/user',
      data:{
        userId:'001'
      },
      dataType:'json'
    })

  })
  $('#btnGet').click(function () {
    $.get(
      '/userGet',
      {
        userId:'001'
      },
      (data)=>{
        console.log(data)
      }
    )
  })

</script>
</body>
</html>